Skip to content

Conversation

mnocon
Copy link
Contributor

@mnocon mnocon commented Jul 14, 2025

PHPStan error:

 Error: Access to protected property Ibexa\Segmentation\Value\Segment::$id.
Error: Access to protected property Ibexa\Segmentation\Value\Segment::$name.
 ------ ----------------------------------------------------------------------- 
  Line   api/public_php_api/src/Command/SegmentCommand.php                      
 ------ ----------------------------------------------------------------------- 
  51     Access to protected property Ibexa\Segmentation\Value\Segment::$id.    
         🪪 property.protected                                                  
  51     Access to protected property Ibexa\Segmentation\Value\Segment::$name.  
         🪪 property.protected   

after changes introduced in https://github.com/ibexa/segmentation/pull/146

@github-actions
Copy link

Preview of modified files: no change to preview.

@github-actions
Copy link

code_samples/ change report

Before (on target branch)After (in current PR)

code_samples/api/public_php_api/src/Command/SegmentCommand.php

docs/users/segment_api.md@17:``` php
docs/users/segment_api.md@18:[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 54, 62) =]]
docs/users/segment_api.md@19:```

001⫶ 'group' => $newSegmentGroup,
002⫶ ]);
003⫶
004⫶ $newSegment = $this->segmentationService->createSegment($segmentCreateStruct);
005⫶
006⫶ $segmentGroup = $this->segmentationService->loadSegmentGroupByIdentifier('custom_group');
007⫶
008⫶ $segments = $this->segmentationService->loadSegmentsAssignedToGroup($segmentGroup);

docs/users/segment_api.md@23:``` php
docs/users/segment_api.md@24:[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 62, 63) =]]
docs/users/segment_api.md@25:```



docs/users/segment_api.md@31:``` php
docs/users/segment_api.md@32:[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 66, 71) =]]
docs/users/segment_api.md@33:```

001⫶ $segment = $this->segmentationService->loadSegmentByIdentifier('segment_1');
002⫶
003⫶ $this->segmentationService->assignUserToSegment($user, $segment);

docs/users/segment_api.md@39:``` php
docs/users/segment_api.md@40:[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 64, 65) =]]
docs/users/segment_api.md@41:```


code_samples/api/public_php_api/src/Command/SegmentCommand.php

docs/users/segment_api.md@17:``` php
docs/users/segment_api.md@18:[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 54, 62) =]]
docs/users/segment_api.md@19:```

001⫶ 'group' => $newSegmentGroup,
002⫶ ]);
003⫶
004⫶ $newSegment = $this->segmentationService->createSegment($segmentCreateStruct);
005⫶
006⫶ $segmentGroup = $this->segmentationService->loadSegmentGroupByIdentifier('custom_group');
007⫶
008⫶ $segments = $this->segmentationService->loadSegmentsAssignedToGroup($segmentGroup);

docs/users/segment_api.md@23:``` php
docs/users/segment_api.md@24:[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 62, 63) =]]
docs/users/segment_api.md@25:```



docs/users/segment_api.md@31:``` php
docs/users/segment_api.md@32:[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 66, 71) =]]
docs/users/segment_api.md@33:```

001⫶ $segment = $this->segmentationService->loadSegmentByIdentifier('segment_1');
002⫶
003⫶ $this->segmentationService->assignUserToSegment($user, $segment);

docs/users/segment_api.md@39:``` php
docs/users/segment_api.md@40:[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 64, 65) =]]
docs/users/segment_api.md@41:```

001⫶            $output->writeln('Segment ID: ' . $segment->id . ', name: ' . $segment->name);
001⫶            $output->writeln('Segment identifier: ' . $segment->getIdentifier() . ', name: ' . $segment->getName());

docs/users/segment_api.md@49:``` php
docs/users/segment_api.md@50:[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 38, 45) =]]
docs/users/segment_api.md@51:```

001⫶ protected function execute(InputInterface $input, OutputInterface $output): int
002⫶ {
003⫶ $user = $this->userService->loadUserByLogin('admin');
004⫶ $this->permissionResolver->setCurrentUserReference($user);
005⫶
006⫶ $segmentGroupCreateStruct = new SegmentGroupCreateStruct([
007⫶ 'name' => 'Custom Group',

docs/users/segment_api.md@55:``` php
docs/users/segment_api.md@56:[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 46, 53) =]]
docs/users/segment_api.md@57:```

001⫶ 'createSegments' => [],
002⫶ ]);
003⫶
004⫶ $newSegmentGroup = $this->segmentationService->createSegmentGroup($segmentGroupCreateStruct);
005⫶
006⫶ $segmentCreateStruct = new SegmentCreateStruct([
007⫶ 'name' => 'Segment 1',


docs/users/segment_api.md@49:``` php
docs/users/segment_api.md@50:[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 38, 45) =]]
docs/users/segment_api.md@51:```

001⫶ protected function execute(InputInterface $input, OutputInterface $output): int
002⫶ {
003⫶ $user = $this->userService->loadUserByLogin('admin');
004⫶ $this->permissionResolver->setCurrentUserReference($user);
005⫶
006⫶ $segmentGroupCreateStruct = new SegmentGroupCreateStruct([
007⫶ 'name' => 'Custom Group',

docs/users/segment_api.md@55:``` php
docs/users/segment_api.md@56:[[= include_file('code_samples/api/public_php_api/src/Command/SegmentCommand.php', 46, 53) =]]
docs/users/segment_api.md@57:```

001⫶ 'createSegments' => [],
002⫶ ]);
003⫶
004⫶ $newSegmentGroup = $this->segmentationService->createSegmentGroup($segmentGroupCreateStruct);
005⫶
006⫶ $segmentCreateStruct = new SegmentCreateStruct([
007⫶ 'name' => 'Segment 1',

Download colorized diff

@mnocon mnocon requested a review from a team July 15, 2025 09:52
@ezrobot ezrobot requested review from adriendupuis, dabrt and julitafalcondusza and removed request for a team July 15, 2025 09:52
@mnocon mnocon merged commit 2bed91e into 5.0 Jul 16, 2025
11 of 12 checks passed
@mnocon mnocon deleted the 5.0-segmentation branch July 16, 2025 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants